package novel.spider.util;

import novel.spider.NovelSiteEnum;
import novel.spider.impl.novel.BxwxNovelSpider;
import novel.spider.impl.novel.KanShuZhongNovelSpider;
import novel.spider.interfaces.INovelSpider;

/**
 * 生成书籍列表的实现类
 * Created by Kau on 2016/11/5.
 */
public final class NovelSpiderFactory {
    private NovelSpiderFactory() {}
    public static INovelSpider getNovelSpider(String url){
        NovelSiteEnum novelSiteEnum = NovelSiteEnum.GetEnumByUrl(url);
        switch (novelSiteEnum){
            case BiXiaWenXue : return new BxwxNovelSpider();
            case KanShuZhong : return new KanShuZhongNovelSpider();
            default : throw new RuntimeException(url + "暂不支持");
        }
    }
}
